package com.lin.controller.Client;

import com.lin.mapper.DishMapper;
import com.lin.mapper.Plus.ShoppingMapperPlus;
import com.lin.mapper.ShoppingMapper;
import com.lin.pojo.Dish;
import com.lin.response.CommonResp;
import com.lin.service.DishService;
import com.lin.service.ShoppingService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/client/dish")
public class DishController {

    @Autowired
    private DishService dishService;

    @Autowired
    private ShoppingService shoppingService;

    @GetMapping("/select")
    public CommonResp page(@RequestParam Integer pageNum,
                                  @RequestParam Integer pageSize,
                                  @RequestParam Integer type,
                                  @RequestParam String name){
        return dishService.page(pageNum,pageSize,type,name);
    }

    @PostMapping("/add")
    public CommonResp first_add(@RequestBody Dish dish,@RequestParam String username){
//        System.out.println(dish);
        return shoppingService.first_add(dish,username);
    }
}
